3.18 \(\int \frac {(c+d x)^3}{a+i a \tan (e+f x)} \, dx\)

Optimal. Leaf size=189 \[ -\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \tan (e+f x))}+\frac {3 i d^3 x}{8 a f^3} \]

[Out]

3/8*I*d^3*x/a/f^3-3/8*d*(d*x+c)^2/a/f^2-1/4*I*(d*x+c)^3/a/f+1/8*(d*x+c)^4/a/d-3/8*d^3/f^4/(a+I*a*tan(f*x+e))-3
/4*I*d^2*(d*x+c)/f^3/(a+I*a*tan(f*x+e))+3/4*d*(d*x+c)^2/f^2/(a+I*a*tan(f*x+e))+1/2*I*(d*x+c)^3/f/(a+I*a*tan(f*
x+e))

________________________________________________________________________________________

Rubi [A]  time = 0.20, antiderivative size = 189, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3723, 3479, 8} \[ -\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \tan (e+f x))}+\frac {3 i d^3 x}{8 a f^3} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^3/(a + I*a*Tan[e + f*x]),x]

[Out]

(((3*I)/8)*d^3*x)/(a*f^3) - (3*d*(c + d*x)^2)/(8*a*f^2) - ((I/4)*(c + d*x)^3)/(a*f) + (c + d*x)^4/(8*a*d) - (3
*d^3)/(8*f^4*(a + I*a*Tan[e + f*x])) - (((3*I)/4)*d^2*(c + d*x))/(f^3*(a + I*a*Tan[e + f*x])) + (3*d*(c + d*x)
^2)/(4*f^2*(a + I*a*Tan[e + f*x])) + ((I/2)*(c + d*x)^3)/(f*(a + I*a*Tan[e + f*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3479

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(a + b*Tan[c + d*x])^n)/(2*b*d*n), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 3723

Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c + d*x)^(m + 1)/(2*
a*d*(m + 1)), x] + (Dist[(a*d*m)/(2*b*f), Int[(c + d*x)^(m - 1)/(a + b*Tan[e + f*x]), x], x] - Simp[(a*(c + d*
x)^m)/(2*b*f*(a + b*Tan[e + f*x])), x]) /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^2, 0] && GtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {(c+d x)^3}{a+i a \tan (e+f x)} \, dx &=\frac {(c+d x)^4}{8 a d}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}-\frac {(3 i d) \int \frac {(c+d x)^2}{a+i a \tan (e+f x)} \, dx}{2 f}\\ &=-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}-\frac {\left (3 d^2\right ) \int \frac {c+d x}{a+i a \tan (e+f x)} \, dx}{2 f^2}\\ &=-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}+\frac {\left (3 i d^3\right ) \int \frac {1}{a+i a \tan (e+f x)} \, dx}{4 f^3}\\ &=-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \tan (e+f x))}-\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}+\frac {\left (3 i d^3\right ) \int 1 \, dx}{8 a f^3}\\ &=\frac {3 i d^3 x}{8 a f^3}-\frac {3 d (c+d x)^2}{8 a f^2}-\frac {i (c+d x)^3}{4 a f}+\frac {(c+d x)^4}{8 a d}-\frac {3 d^3}{8 f^4 (a+i a \tan (e+f x))}-\frac {3 i d^2 (c+d x)}{4 f^3 (a+i a \tan (e+f x))}+\frac {3 d (c+d x)^2}{4 f^2 (a+i a \tan (e+f x))}+\frac {i (c+d x)^3}{2 f (a+i a \tan (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.71, size = 278, normalized size = 1.47 \[ \frac {\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (2 f^4 x \left (4 c^3+6 c^2 d x+4 c d^2 x^2+d^3 x^3\right ) (\cos (e)+i \sin (e))+(\cos (e)-i \sin (e)) \cos (2 f x) \left (4 i c^3 f^3+6 c^2 d f^2 (1+2 i f x)+6 c d^2 f \left (2 i f^2 x^2+2 f x-i\right )+d^3 \left (4 i f^3 x^3+6 f^2 x^2-6 i f x-3\right )\right )+(\cos (e)-i \sin (e)) \sin (2 f x) \left (4 c^3 f^3+6 c^2 d f^2 (2 f x-i)+6 c d^2 f \left (2 f^2 x^2-2 i f x-1\right )+d^3 \left (4 f^3 x^3-6 i f^2 x^2-6 f x+3 i\right )\right )\right )}{16 f^4 (a+i a \tan (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^3/(a + I*a*Tan[e + f*x]),x]

[Out]

(Sec[e + f*x]*(Cos[f*x] + I*Sin[f*x])*(((4*I)*c^3*f^3 + 6*c^2*d*f^2*(1 + (2*I)*f*x) + 6*c*d^2*f*(-I + 2*f*x +
(2*I)*f^2*x^2) + d^3*(-3 - (6*I)*f*x + 6*f^2*x^2 + (4*I)*f^3*x^3))*Cos[2*f*x]*(Cos[e] - I*Sin[e]) + 2*f^4*x*(4
*c^3 + 6*c^2*d*x + 4*c*d^2*x^2 + d^3*x^3)*(Cos[e] + I*Sin[e]) + (4*c^3*f^3 + 6*c^2*d*f^2*(-I + 2*f*x) + 6*c*d^
2*f*(-1 - (2*I)*f*x + 2*f^2*x^2) + d^3*(3*I - 6*f*x - (6*I)*f^2*x^2 + 4*f^3*x^3))*(Cos[e] - I*Sin[e])*Sin[2*f*
x]))/(16*f^4*(a + I*a*Tan[e + f*x]))

________________________________________________________________________________________

fricas [A]  time = 0.51, size = 162, normalized size = 0.86 \[ \frac {{\left (4 i \, d^{3} f^{3} x^{3} + 4 i \, c^{3} f^{3} + 6 \, c^{2} d f^{2} - 6 i \, c d^{2} f - 3 \, d^{3} + {\left (12 i \, c d^{2} f^{3} + 6 \, d^{3} f^{2}\right )} x^{2} + {\left (12 i \, c^{2} d f^{3} + 12 \, c d^{2} f^{2} - 6 i \, d^{3} f\right )} x + 2 \, {\left (d^{3} f^{4} x^{4} + 4 \, c d^{2} f^{4} x^{3} + 6 \, c^{2} d f^{4} x^{2} + 4 \, c^{3} f^{4} x\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{16 \, a f^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3/(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/16*(4*I*d^3*f^3*x^3 + 4*I*c^3*f^3 + 6*c^2*d*f^2 - 6*I*c*d^2*f - 3*d^3 + (12*I*c*d^2*f^3 + 6*d^3*f^2)*x^2 + (
12*I*c^2*d*f^3 + 12*c*d^2*f^2 - 6*I*d^3*f)*x + 2*(d^3*f^4*x^4 + 4*c*d^2*f^4*x^3 + 6*c^2*d*f^4*x^2 + 4*c^3*f^4*
x)*e^(2*I*f*x + 2*I*e))*e^(-2*I*f*x - 2*I*e)/(a*f^4)

________________________________________________________________________________________

giac [A]  time = 0.67, size = 193, normalized size = 1.02 \[ \frac {{\left (2 \, d^{3} f^{4} x^{4} e^{\left (2 i \, f x + 2 i \, e\right )} + 8 \, c d^{2} f^{4} x^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + 12 \, c^{2} d f^{4} x^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, d^{3} f^{3} x^{3} + 8 \, c^{3} f^{4} x e^{\left (2 i \, f x + 2 i \, e\right )} + 12 i \, c d^{2} f^{3} x^{2} + 12 i \, c^{2} d f^{3} x + 6 \, d^{3} f^{2} x^{2} + 4 i \, c^{3} f^{3} + 12 \, c d^{2} f^{2} x + 6 \, c^{2} d f^{2} - 6 i \, d^{3} f x - 6 i \, c d^{2} f - 3 \, d^{3}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{16 \, a f^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

1/16*(2*d^3*f^4*x^4*e^(2*I*f*x + 2*I*e) + 8*c*d^2*f^4*x^3*e^(2*I*f*x + 2*I*e) + 12*c^2*d*f^4*x^2*e^(2*I*f*x +
2*I*e) + 4*I*d^3*f^3*x^3 + 8*c^3*f^4*x*e^(2*I*f*x + 2*I*e) + 12*I*c*d^2*f^3*x^2 + 12*I*c^2*d*f^3*x + 6*d^3*f^2
*x^2 + 4*I*c^3*f^3 + 12*c*d^2*f^2*x + 6*c^2*d*f^2 - 6*I*d^3*f*x - 6*I*c*d^2*f - 3*d^3)*e^(-2*I*f*x - 2*I*e)/(a
*f^4)

________________________________________________________________________________________

maple [B]  time = 0.65, size = 1061, normalized size = 5.61 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^3/(a+I*a*tan(f*x+e)),x)

[Out]

1/a/f*(-3/2*I/f*c^2*d*e*cos(f*x+e)^2+1/2*I*c^3*cos(f*x+e)^2-3*I/f^3*d^3*e^2*(-1/2*(f*x+e)*cos(f*x+e)^2+1/4*sin
(f*x+e)*cos(f*x+e)+1/4*f*x+1/4*e)-I/f^3*d^3*(-1/2*(f*x+e)^3*cos(f*x+e)^2+3/2*(f*x+e)^2*(1/2*sin(f*x+e)*cos(f*x
+e)+1/2*f*x+1/2*e)+3/4*(f*x+e)*cos(f*x+e)^2-3/8*sin(f*x+e)*cos(f*x+e)-3/8*f*x-3/8*e-1/2*(f*x+e)^3)+3/2*I/f^2*c
*d^2*e^2*cos(f*x+e)^2-3*I/f*c^2*d*(-1/2*(f*x+e)*cos(f*x+e)^2+1/4*sin(f*x+e)*cos(f*x+e)+1/4*f*x+1/4*e)+3*I/f^3*
d^3*e*(-1/2*(f*x+e)^2*cos(f*x+e)^2+(f*x+e)*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1/4*(f*x+e)^2-1/4*sin(f*x
+e)^2)+6*I/f^2*c*d^2*e*(-1/2*(f*x+e)*cos(f*x+e)^2+1/4*sin(f*x+e)*cos(f*x+e)+1/4*f*x+1/4*e)-1/2*I/f^3*d^3*e^3*c
os(f*x+e)^2-3*I/f^2*c*d^2*(-1/2*(f*x+e)^2*cos(f*x+e)^2+(f*x+e)*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1/4*(
f*x+e)^2-1/4*sin(f*x+e)^2)+1/f^3*d^3*((f*x+e)^3*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+3/4*(f*x+e)^2*cos(f*
x+e)^2-3/2*(f*x+e)*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+3/8*(f*x+e)^2+3/8*sin(f*x+e)^2-3/8*(f*x+e)^4)+3/f
^2*c*d^2*((f*x+e)^2*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+1/2*(f*x+e)*cos(f*x+e)^2-1/4*sin(f*x+e)*cos(f*x+
e)-1/4*f*x-1/4*e-1/3*(f*x+e)^3)-3/f^3*d^3*e*((f*x+e)^2*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+1/2*(f*x+e)*c
os(f*x+e)^2-1/4*sin(f*x+e)*cos(f*x+e)-1/4*f*x-1/4*e-1/3*(f*x+e)^3)+3/f*c^2*d*((f*x+e)*(1/2*sin(f*x+e)*cos(f*x+
e)+1/2*f*x+1/2*e)-1/4*(f*x+e)^2-1/4*sin(f*x+e)^2)-6/f^2*c*d^2*e*((f*x+e)*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/
2*e)-1/4*(f*x+e)^2-1/4*sin(f*x+e)^2)+3/f^3*d^3*e^2*((f*x+e)*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1/4*(f*x
+e)^2-1/4*sin(f*x+e)^2)+c^3*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-3/f*c^2*d*e*(1/2*sin(f*x+e)*cos(f*x+e)+1
/2*f*x+1/2*e)+3/f^2*c*d^2*e^2*(1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1/f^3*d^3*e^3*(1/2*sin(f*x+e)*cos(f*x+
e)+1/2*f*x+1/2*e))

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^3/(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: Error executing code in Maxima: expt: undefined: 0 to a negative e
xponent.

________________________________________________________________________________________

mupad [B]  time = 3.56, size = 423, normalized size = 2.24 \[ \frac {8\,c^3\,f^4\,x-3\,d^3\,\cos \left (2\,e+2\,f\,x\right )+4\,c^3\,f^3\,\sin \left (2\,e+2\,f\,x\right )+2\,d^3\,f^4\,x^4+6\,c^2\,d\,f^2\,\cos \left (2\,e+2\,f\,x\right )+12\,c^2\,d\,f^4\,x^2+8\,c\,d^2\,f^4\,x^3+6\,d^3\,f^2\,x^2\,\cos \left (2\,e+2\,f\,x\right )+4\,d^3\,f^3\,x^3\,\sin \left (2\,e+2\,f\,x\right )-6\,c\,d^2\,f\,\sin \left (2\,e+2\,f\,x\right )-6\,d^3\,f\,x\,\sin \left (2\,e+2\,f\,x\right )+12\,c\,d^2\,f^2\,x\,\cos \left (2\,e+2\,f\,x\right )+12\,c^2\,d\,f^3\,x\,\sin \left (2\,e+2\,f\,x\right )+12\,c\,d^2\,f^3\,x^2\,\sin \left (2\,e+2\,f\,x\right )+d^3\,\sin \left (2\,e+2\,f\,x\right )\,3{}\mathrm {i}+c^3\,f^3\,\cos \left (2\,e+2\,f\,x\right )\,4{}\mathrm {i}-c^2\,d\,f^2\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+d^3\,f^3\,x^3\,\cos \left (2\,e+2\,f\,x\right )\,4{}\mathrm {i}-d^3\,f^2\,x^2\,\sin \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-c\,d^2\,f\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}-d^3\,f\,x\,\cos \left (2\,e+2\,f\,x\right )\,6{}\mathrm {i}+c^2\,d\,f^3\,x\,\cos \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}-c\,d^2\,f^2\,x\,\sin \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}+c\,d^2\,f^3\,x^2\,\cos \left (2\,e+2\,f\,x\right )\,12{}\mathrm {i}}{16\,a\,f^4} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)^3/(a + a*tan(e + f*x)*1i),x)

[Out]

(d^3*sin(2*e + 2*f*x)*3i - 3*d^3*cos(2*e + 2*f*x) + 8*c^3*f^4*x + c^3*f^3*cos(2*e + 2*f*x)*4i + 4*c^3*f^3*sin(
2*e + 2*f*x) + 2*d^3*f^4*x^4 + 6*c^2*d*f^2*cos(2*e + 2*f*x) - c^2*d*f^2*sin(2*e + 2*f*x)*6i + 12*c^2*d*f^4*x^2
 + 8*c*d^2*f^4*x^3 + 6*d^3*f^2*x^2*cos(2*e + 2*f*x) + d^3*f^3*x^3*cos(2*e + 2*f*x)*4i - d^3*f^2*x^2*sin(2*e +
2*f*x)*6i + 4*d^3*f^3*x^3*sin(2*e + 2*f*x) - c*d^2*f*cos(2*e + 2*f*x)*6i - 6*c*d^2*f*sin(2*e + 2*f*x) - d^3*f*
x*cos(2*e + 2*f*x)*6i - 6*d^3*f*x*sin(2*e + 2*f*x) + 12*c*d^2*f^2*x*cos(2*e + 2*f*x) + c^2*d*f^3*x*cos(2*e + 2
*f*x)*12i - c*d^2*f^2*x*sin(2*e + 2*f*x)*12i + 12*c^2*d*f^3*x*sin(2*e + 2*f*x) + c*d^2*f^3*x^2*cos(2*e + 2*f*x
)*12i + 12*c*d^2*f^3*x^2*sin(2*e + 2*f*x))/(16*a*f^4)

________________________________________________________________________________________

sympy [A]  time = 0.38, size = 262, normalized size = 1.39 \[ \begin {cases} - \frac {\left (- 4 i c^{3} f^{3} - 12 i c^{2} d f^{3} x - 6 c^{2} d f^{2} - 12 i c d^{2} f^{3} x^{2} - 12 c d^{2} f^{2} x + 6 i c d^{2} f - 4 i d^{3} f^{3} x^{3} - 6 d^{3} f^{2} x^{2} + 6 i d^{3} f x + 3 d^{3}\right ) e^{- 2 i e} e^{- 2 i f x}}{16 a f^{4}} & \text {for}\: 16 a f^{4} e^{2 i e} \neq 0 \\\frac {c^{3} x e^{- 2 i e}}{2 a} + \frac {3 c^{2} d x^{2} e^{- 2 i e}}{4 a} + \frac {c d^{2} x^{3} e^{- 2 i e}}{2 a} + \frac {d^{3} x^{4} e^{- 2 i e}}{8 a} & \text {otherwise} \end {cases} + \frac {c^{3} x}{2 a} + \frac {3 c^{2} d x^{2}}{4 a} + \frac {c d^{2} x^{3}}{2 a} + \frac {d^{3} x^{4}}{8 a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**3/(a+I*a*tan(f*x+e)),x)

[Out]

Piecewise((-(-4*I*c**3*f**3 - 12*I*c**2*d*f**3*x - 6*c**2*d*f**2 - 12*I*c*d**2*f**3*x**2 - 12*c*d**2*f**2*x +
6*I*c*d**2*f - 4*I*d**3*f**3*x**3 - 6*d**3*f**2*x**2 + 6*I*d**3*f*x + 3*d**3)*exp(-2*I*e)*exp(-2*I*f*x)/(16*a*
f**4), Ne(16*a*f**4*exp(2*I*e), 0)), (c**3*x*exp(-2*I*e)/(2*a) + 3*c**2*d*x**2*exp(-2*I*e)/(4*a) + c*d**2*x**3
*exp(-2*I*e)/(2*a) + d**3*x**4*exp(-2*I*e)/(8*a), True)) + c**3*x/(2*a) + 3*c**2*d*x**2/(4*a) + c*d**2*x**3/(2
*a) + d**3*x**4/(8*a)

________________________________________________________________________________________